package org.zxp.designpattern.strategy;

/**
 * @program: effectiveJava
 * @description:
 * @author: X-Pacific zhang
 * @create: 2019-08-23 12:07
 **/
public class Test {
    public static void main(String[] args){
        Calculate c = new Plus();
        Calculator calculator = new Calculator(c);
        System.out.println(calculator.calc(1, 2));

        c = new Multiply();
        calculator = new Calculator(c);
        System.out.println(calculator.calc(1, 2));
    }

}
